/*
 * @(#)XCAGatewayConfig.java
 * Date 2013-10-19
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */


package us.hornerscorners.lamppost.ihecommon.config;

import us.hornerscorners.lamppost.config.BasicServiceConfig;
import java.util.ArrayList;
import java.util.List;


/**
 * Class description
 *
 *
 * @version        v1.0, 2013-10-19
 * @author         Jim Horner
 */
public class XCAGatewayConfig extends BasicServiceConfig {

    /** Field description */
    private PatientDiscoveryMode patientDiscoveryMode;

    /** Field description */
    private String pixServiceId;

    /** Field description */
    private String registryServiceId;

    /** Field description */
    private List<String> repositories;

    /** Field description */
    private List<RespondingGatewayConfig> respondingGateways;

    /**
     * Constructs ...
     *
     */
    public XCAGatewayConfig() {

        super(IHEServiceType.XCA);

        this.respondingGateways = new ArrayList<>();
        this.repositories = new ArrayList<>();
    }

    /**
     * Method description
     *
     *
     * @param homeCommunityId
     *
     * @return
     */
    public RespondingGatewayConfig findRespondingGateway(String homeCommunityId) {

        RespondingGatewayConfig result = null;

        for (RespondingGatewayConfig config : this.respondingGateways) {

            if (config.getHomeCommunityId().equals(homeCommunityId)) {

                result = config;

                break;
            }
        }

        return result;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public PatientDiscoveryMode getPatientDiscoveryMode() {
        return patientDiscoveryMode;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getPixServiceId() {
        return pixServiceId;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getRegistryServiceId() {
        return registryServiceId;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public List<String> getRepositories() {
        return repositories;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public List<RespondingGatewayConfig> getRespondingGateways() {
        return respondingGateways;
    }

    /**
     * Method description
     *
     *
     * @param patientDiscoveryMode
     */
    public void setPatientDiscoveryMode(PatientDiscoveryMode patientDiscoveryMode) {
        this.patientDiscoveryMode = patientDiscoveryMode;
    }

    /**
     * Method description
     *
     *
     * @param pixServiceId
     */
    public void setPixServiceId(String pixServiceId) {
        this.pixServiceId = pixServiceId;
    }

    /**
     * Method description
     *
     *
     * @param registryServiceId
     */
    public void setRegistryServiceId(String registryServiceId) {
        this.registryServiceId = registryServiceId;
    }

    /**
     * Method description
     *
     *
     * @param repositories
     */
    public void setRepositories(List<String> repositories) {
        this.repositories = repositories;
    }

    /**
     * Method description
     *
     *
     * @param respondingGateways
     */
    public void setRespondingGateways(List<RespondingGatewayConfig> respondingGateways) {
        this.respondingGateways = respondingGateways;
    }
}
